import { createStore } from "redux";
const initstate ={
    count:0
}
const reduder=(state=initstate,action)=>{
    switch(action.type){
        case"increase":
        let newState =JSON.parse(JSON.stringify(state));
        newState.count+=1
        return newState
        case"decrease":
        return {count:state.count-1}
        default:
        return state
    }
}
let store=createStore(reduder);
export default store

/* 1.创建了store用来放置数据 
    2.reducer函数用来接收dispatch派发狗来的action
*/